from flask import Flask, render_template
from gamebox.api import api_request_process
from gamebox.decorators import login_required

app = Flask(__name__)
app.debug = True
app.secret_key = 'A0Zr98j/3yX R~XHH!jmN]LWX/,?RT'


@app.route('/login')
def login():
    return render_template('index.html')


@app.route('/')
@login_required()
def home():
    return render_template('index.html')


@app.route('/api/v1', methods=['GET', 'POST', 'PUT', 'DELETE'])
def api_gateway():
    return api_request_process()


if __name__ == '__main__':
    app.run()
